<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>短信发送管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			//$("#name").focus();
			$("#inputForm").validate({
				submitHandler: function(form){
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
            $("#btnExport").click(function(){
                var smsId = $("#smsId").val();
				top.$.jBox.confirm("确认要导出用户数据吗？","系统提示",function(v,h,f){
					 if(v=="ok"){
						 $("#inputForm").attr("action","${ctx}/sms/smsSend/exprotSmsPhone?id=" + smsId);
						 $("#inputForm").submit();
					 }
				 },{buttonsFocus:1});
				 top.$('.jbox-body .jbox-icon').css('top','55px');
            });
		});
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/sms/smsSend/">短信发送列表</a></li>
	</ul><br/>
	<form:form id="inputForm" modelAttribute="smsSend" action="" method="post" class="form-horizontal">
		<form:hidden path="id" id="smsId"/>
		<sys:message content="${message}"/>		
		<div class="control-group">
			<label class="control-label">ID：</label>
			<div class="controls">
				<form:input path="id" htmlEscape="false" maxlength="32" class="input-xlarge required"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">提单号：</label>
			<div class="controls">
				<form:input path="taskid" htmlEscape="false" maxlength="32" class="input-xlarge required"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">手机号码：</label>
			<div class="controls">
				<form:textarea path="phone" htmlEscape="false" class="input-xlarge required" rows="10" cols="3"/>
			</div>
		</div>
		<div class="form-actions">
			<%--<shiro:hasPermission name="sms:smsSend:edit"><input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;</shiro:hasPermission>--%>
			<shiro:hasPermission name="sms:smsSend:edit"><input id="btnExport"  class="btn btn-primary" type="button" value="下载号码"/>&nbsp;</shiro:hasPermission>
			<input id="btnCancel" class="btn" type="button" value="关闭" onclick="window.close()"/>
		</div>
	</form:form>
</body>
</html>